/**
 * 设置主题
 * @param theme 主题
 */
export const loadTheme = (theme: string) => {
	const styleNode = document.createElement("style");
	styleNode.setAttribute("type", "text/css");
	styleNode.innerHTML = theme;
	styleNode.id = "theme-css";
	const headNode = document.querySelector("head");
	const themeDom = document.querySelector("#theme-css");
	if (themeDom) {
		themeDom.remove();
	}
	headNode?.appendChild(styleNode);
};
